<%-- 
    Document   : index
    Created on : 15-ago-2012, 1:06:48
    Author     : Edu
--%>

<%@page import="Entities.Nivelusuario"%>
<%@page import="java.util.Iterator"%>
<%@page import="javax.persistence.Query"%>
<%@page import="javax.persistence.Persistence"%>
<%@page import="javax.persistence.EntityManager"%>
<%@page import="javax.persistence.EntityManagerFactory"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="style.css" rel="stylesheet" type="text/css" />
        <title>JSP Page</title>
		<body>
		<div id="frame">
                    <div id="headcontainer">
                        <div id="leftcontainer">
        			<div id="logo"><a href="index.jsp"><img src="images/sucar03.jpg" alt="" title="" width="267" height="40" /></a></div>
                        </div>
				<div id="rightcontainer">
                                    <div id="searchcontainer">
                                        <div id="sleft"><img src="images/searchbgleft.jpg" alt="" /> </div>
                                            <div id="smiddle">
                                                <div id="search">Search:</div>
                                                    <div id="sbox">
                                                        <form id="form1" name="form1" method="post" action="">
                                                            <input type="text" name="textfield"  style="width:100px; height:15px; border:1px solid #B2B2B1;" />
                                                        </form>
                                                    </div>
                                                    <div id="sbutton">
                                                        <label>
                                                            <input type="image" name="imageField" src="images/searchbutton.jpg" title="Go" />
                                                        </label>
                                                    </div>
                                            </div>
                                            <div id="sright"><img src="images/searchbgright.jpg" alt="" /></div>
                                    </div>
                                </div>
                                    <br class="spacer" />
				</div>
	
                                <div id="banner">
                                    <div id="bleft"  > 
                                        <div id="bright"  >
                                            <div id="brcategory" >
                                                <div id="category" align="center" ><a href="Admin.jsp" class="ctxt" title="sub">Sub Menu</a></div>
                                                    <div class="categorynav">
                                                        <div class="cbullet">
                                                            <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
							</div>
                                                        <a href="cliente distribuidor.jsp" class="ctxt" title="apple">Cliente distribuidor</a></div>
                                                        <div class="categorynav" >
                                                            <div class="cbullet">
                                                            <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                        </div>
                                                        <a href="eliminar usuario.jsp" class="ctxt" title="apricot">Eliminar Usuario</a></div>
                                                            <div class="categorynav">
                                                                <div class="cbullet">
                                                                    <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                                </div>
								<a href="modificar usuario.jsp" class="ctxt" title="banana">Modificar Usuario</a></div>
								<div class="categorynav">
                                                                    <div class="cbullet">
                                                                        <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                                    </div>
                                                                    <a href="cliente industrial.jsp" class="ctxt" title="cherries">Cliente Industrial</a></div>
                                                                    <div class="categorynav">
                                                                        <div class="cbullet">
                                                                            <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
									</div>
									<a href="modificar cliente distribuidor.jsp" class="ctxt" title="grape">Modf. Client Dist.</a></div>
									<div class="categorynav">
                                                                            <div class="cbullet">
                                                                                <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                                            </div>
                                                                            <a href="cliente potencial.jsp" class="ctxt" title="papaya">Cliente Potencial</a></div>
                                                                            <div class="categorynav">
                                                                                <div class="cbullet">
                                                                                    <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
										</div>
										<a href="modificar cliente potencial.jsp" class="ctxt" title="pear">Modf. Cliente Pote.</a></div>
										<div class="categorynav">
                                                                                    <div class="cbullet">
                                                                                        <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                                                    </div>
                                                                                    <a href="seguimiento potencial.jsp" class="ctxt" title="raspberry">Nuevo Seguimiento</a></div>
                                                                                    <div class="categorynav">
                                                                                        <div class="cbullet">
                                                                                            <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
                                                                                                </div>
                                                                                                    <a href="nueva queja.jsp" class="ctxt" title="watermelon">Quejas</a></div>
                                                                                                    <div class="categorynav">
                                                                                                        <div class="cbullet">
                                                                                                            <div class="bullet"><img src="images/bullet1.jpg" alt="" /></div>
													</div>
													<a href="seguimiento queja.jsp" class="ctxt" title="watermelon">Seguimineto Quejas</a></div>
													<div id="cmore"><a href="construccion.jsp" class="ctxt" title="more">...more</a></div>
                                            </div>
                                        </div>
                                            <div id="centers">
                                                <table width="592" border="0">
                                                    <tr>
                                                        <th width="582" scope="row">Ingresar un Nuevo Usuario </th>
                                                    </tr>
                                                </table>
                                                    <form id="form1" name="form1" method="post" action="http://localhost:8080/appwebdizucar/nuevoUsuario">
                                                        <table width="288" border="0" align="center">
                                                            <tr></tr>
                                                            <tr>
                                                                <td width="92">Nombre:</td>
                                                                <td width="152"><label for="txtnombre"></label>
                                                                    <input type="text" name="txtnombre" id="txtnombre" /></td>
                                                            </tr>
                                                            <tr>
                                                                <td>Apellido:</td>
                                                                <td><input type="text" name="txtapellido" id="txtapellido" /></td>
                                                            </tr>
                                                            <tr>
                                                                <td>Usuario:</td>
                                                                <td><input type="text" name="txtusuario" id="txtusuario" /></td>
                                                            </tr>
                                                            <tr>
                                                                <td>Contraseña:</td>
                                                                <td><input type="text" name="txtpass" id="txtpass" /></td>
                                                            </tr>
                                                            <tr>
                                                                <td>Nivel</td>
                                                                <td><label for="cbnivel"></label>

                                                                    <%
                                                                        EntityManagerFactory emf=Persistence.createEntityManagerFactory("PU");
                                                                        EntityManager em=emf.createEntityManager();
                                                                        Query result = em.createNamedQuery("Nivelusuario.findAll");
                                                                        String nivel;
                                                                        int nivelid;
                                                                        java.util.List nivelUsList = result.getResultList();
                                                                        Iterator itr=nivelUsList.iterator();
                                                                        out.println("<select name='cbnivel' id='cbnivel'>");
                                                                        while(itr.hasNext())
                                                                            {
                                                                                Nivelusuario nus=(Nivelusuario)itr.next();
                                                                                nivel=nus.getNivel();
                                                                                nivelid=nus.getIdnivel();
                                                                                out.println("<option value="+nivelid+">"+nivel+"</option>");
                                                                            }

                                                                        out.println("</select></td>");
                                                                    %>


                                                            </tr>
                                                            <tr>
                                                            <td><input type="submit" name="btnok" id="btnok" value="Aceptar" /></td>
                                                            <td align="right"><input type="reset" name="btnno" id="btnno" value="Cancelar" /></td>
                                                            </tr>
                                                        </table>
                                                        </form>
                                                <%em.close();emf.close();%>
						</div>
                                    </div>
                                </div>
				<div class="blank"></div>
                                    <div id="bodycontainer"><br class="spacer" /></div>
                                <div class="blank"></div>
                                    <div id="footercontainercenter">
                                        <div id="fooertleft"></div>
                                        <div id="footeright">
                                        <div id="frtop">
                                            <div id="fooertxt"><span class="fnav">Home</span> &nbsp;| &nbsp;  <a href="#" class="fnav" title="About Us">About Us</a> &nbsp;| &nbsp; <a href="#" class="fnav" title="Services">Services</a> &nbsp;| &nbsp; <a href="#" class="fnav" title="Food gallery">Food gallery</a>&nbsp; |&nbsp;  <a href="#" class="fnav" title="Pricing &amp; Ordering">Pricing &amp; Ordering</a> &nbsp; | &nbsp;  <a href="#" class="fnav" title="Delivery &amp; Shipping">Delivery &amp; Shipping</a>  &nbsp;| &nbsp; <a href="#" class="fnav" title="Contacts">Contacts</a></div>
                                        </div>
                                        <div>
                                            <div class="copyrighttxt" id="copyright">Copyright &copy; 2006. All rights reserved.<br />
                                                Designed by <a href="http://www.free-css-templates.com/">Free CSS Templates</a>, Thanks to <a href="http://www.openwebdesign.org/">Web Design UK</a></div>
                                            <div id="cardcontainer"></div>
                                        </div>
                                        <div></div>
                                        </div>
                                        <br class="spacer" />	
                                    </div>
                </div>
	
	</body>
</html>
